#include<bits/stdc++.h>
using namespace std;
int main()
{
	int m, n;
	cin >> m;
	for (int i = 1; i <= m; i++) {
		double an = 1;
		cin >> n;
		for (int i = 2; i <= n; i++) {
			if(i % 2){
				an += 1.000 / i;
			}else{
				an -= 1.000 / i;
			}
		}
		cout << fixed << setprecision(2) << an << endl;
	}
	return 0;
}
